package common.kingdee.repository;

import org.junit.After;
import org.junit.Before;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import common.security.dao.mapper.FunctionMapper;
import common.security.dao.mapper.SecurityConfigurationMapper;
import common.security.dao.mapper.SecurityRoleConfigurationMapper;
import common.security.dao.mapper.SecurityRoleMapper;
import common.security.dao.mapper.SecurityRoleUserMapper;
import common.security.dao.mapper.SecurityUserMapper;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = "classpath*:/META-INF/applicationContext.xml")
public abstract class RepositoryBaseTestCase {
	@Autowired
	FunctionMapper functionMapper;
	@Autowired
	SecurityConfigurationMapper securityConfigurationMapper;
    @Autowired
    SecurityRoleConfigurationMapper securityRoleConfigurationMapper;
    @Autowired
    SecurityRoleMapper securityRoleMapper;
    @Autowired
    SecurityUserMapper securityUserMapper;
    @Autowired
    SecurityRoleUserMapper securityRoleUserMapper;
	@Before
	@After
    public void deleteAll(){
		securityRoleConfigurationMapper.deleteAll();
		securityRoleUserMapper.deleteAll();
		functionMapper.deleteAll();
		securityConfigurationMapper.deleteAll();
		securityRoleMapper.deleteAll();
		securityUserMapper.deleteAll();
   }
}
